// directives/lazyLoad.js
export default {
    inserted(el, binding) {
      const observer = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
          if (entry.isIntersecting) {
            const img = entry.target
            img.src = img.dataset.src
            observer.unobserve(img)
          }
        })
      })
      
      el.dataset.src = binding.value
      observer.observe(el)
    }
  }
  

